<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class IconsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        //填充数据
        // Binary data for the SVG icon (already in binary format)  
        // Prepare the data to be inserted  
        $icons = [
            [
                'id' => 1,
                'icon_type' => '"img""png""jpg""webp""ico""bmp""tif""tga"',
                'icon_name' => '图片',
                'icon_data' => 'image.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 2,
                'icon_type' => '"mp3""wma""m4a"',
                'icon_name' => '音乐',
                'icon_data' => 'file-music.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 3,
                'icon_type' => '"zip""rar""7z"',
                'icon_name' => '压缩文件',
                'icon_data' => 'file-earmark-zip.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 4,
                'icon_type' =>  '"doc""docx""txt""wps""wpt""dot"',
                'icon_name' => '文本文档',
                'icon_data' => 'filetype-doc.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 5,
                'icon_type' =>  '"ppt""pptx""dps""dpt""pot""pps"',
                'icon_name' => '演示文档PPT',
                'icon_data' => 'filetype-ppt.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 6,
                'icon_type' => '"pdf"',
                'icon_name' => 'pdf',
                'icon_data' => 'file-pdf.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 7,
                'icon_type' => '"xlsm""et""ett""xls""xlt""xlsx"',
                'icon_name' =>  'Excel',
                'icon_data' => 'filetype-xls.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 8,
                'icon_type' =>  '"mp4""mkv""webm"',
                'icon_name' =>  '视频',
                'icon_data' => 'file-music.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 519,
                'icon_type' =>  '"文件夹类型"',
                'icon_name' =>  '文件夹',
                'icon_data' =>  'folder.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
            [
                'id' => 520,
                'icon_type' =>  '"未知类型"',
                'icon_name' =>  '未知类型',
                'icon_data' =>  'file.svg',
                'created_at' => null,
                'updated_at' => null,
            ],
        ];
        foreach ($icons as $icon) {
            DB::table('icons')->insert([
                'id' => $icon['id'],
                'icon_type' => $icon['icon_type'],
                'icon_name' => $icon['icon_name'],
                'icon_data' => $icon['icon_data'],
                'created_at' => $icon['created_at'],
                'updated_at' => $icon['updated_at'],
            ]);
        }
    }
}
